load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@rules_proto_grpc_go//:defs.bzl", "GRPC_DEPS", "go_grpc_library")

go_grpc_library(
    name = "routeguide",
    importpath = "google.golang.org/grpc/examples/route_guide/routeguide",
    protos = ["@rules_proto_grpc_example_protos//:routeguide_proto"],
)

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "google.golang.org/grpc/examples/route_guide/server",
    visibility = ["//visibility:private"],
    deps = [
        ":routeguide",
    ] + GRPC_DEPS,
)

go_binary(
    name = "server",
    data = ["@rules_proto_grpc_example_protos//:routeguide_features"],
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "go_default_test",
    size = "small",
    srcs = [
        "main_test.go",
    ],
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)
